package com.situ.mall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.situ.mall.common.ServerResponse;
import com.situ.mall.entity.Order;
import com.situ.mall.entity.OrderItem;
import com.situ.mall.entity.Product;
import com.situ.mall.mapper.OrderItemMapper;
import com.situ.mall.mapper.OrderMapper;
import com.situ.mall.mapper.ProductMapper;
import com.situ.mall.service.IOrderItemService;
import com.situ.mall.service.IOrderService;
import com.situ.mall.service.IProductService;

@Service
public class OrderItemServiceImpl implements IOrderItemService {
	@Autowired
	private OrderItemMapper OrderItemMapper;

	@Override
	public Integer selectCountByUserId(Integer userId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<OrderItem> selectByUserId(Integer userId) {
		return OrderItemMapper.selectByUserId(userId);
	}

	@Override
	public OrderItem selectByProductId(Integer productId) {
		
		return OrderItemMapper.selectByProductId(productId);
	}

	@Override
	public int insertByProductId(Integer productId) {
		Integer count = OrderItemMapper.insertByProductId(productId);
		return count;
	}

	@Override
	public int insertSelective(OrderItem orderItem) {
		Integer count = OrderItemMapper.insertSelective(orderItem);
		return 0;
	}

	

}